Prevent points cache when other than select query is used
authorJeroen van der Heijden <jeroen@transceptor.technology>
Wed, 16 May 2018 12:05:59 +0000 (14:05 +0200)
committerJeroen van der Heijden <jeroen@transceptor.technology>
Wed, 16 May 2018 12:05:59 +0000 (14:05 +0200)
ChangeLog-2.0.27
src/siri/parser/listener.c

index 7b3b91986dba06f68b3b89a2f2415c53bb940b74..ba7d8dfbf2678727dd49f1b821da42964ccf0f88 100644 (file)
@@ -18,3 +18,5 @@
     
   * Allow all (*) for selecting series. Keyword 'all' replaces 'points' which
     is now a deprecated keyword.
+
+  * Solved compiler warnings. (issue #96)
\ No newline at end of file
index 7a64bc02a5e4a575801532913e7a155064df7acd..0c2d051a35fc8b6f879c34fad7825bc74cd35ab7 100644 (file)
@@ -3272,19 +3272,24 @@ static void exit_revoke_user(uv_async_t * handle)
 static void exit_series_match(uv_async_t * handle)
 {
     siridb_query_t * query = (siridb_query_t *) handle->data;
-    query_select_t * q_select = (query_select_t *) query->data;
+    query_wrapper_t * q_wrapper = (query_wrapper_t *) query->data;
 
-    if ((q_select->flags & QUERIES_SKIP_GET_POINTS) &&
-         (q_select->start_ts != NULL || q_select->end_ts != NULL))
+    if (q_wrapper->tp == QUERIES_SELECT)
     {
-        q_select->flags &= ~QUERIES_SKIP_GET_POINTS;
-    }
+        query_select_t * q_select = (query_select_t *) q_wrapper;
+        if ((q_select->flags & QUERIES_SKIP_GET_POINTS) &&
+                (q_select->start_ts != NULL || q_select->end_ts != NULL))
+        {
+            q_select->flags &= ~QUERIES_SKIP_GET_POINTS;
+        }
 
-    if ((~q_select->flags & QUERIES_SKIP_GET_POINTS) && q_select->nselects > 1)
-    {
-        /* We have more than one select request, let's use points caching.
-         * (Not critical, everything works if points_map is NULL) */
-        q_select->points_map = imap_new();
+        if ((~q_select->flags & QUERIES_SKIP_GET_POINTS) &&
+                q_select->nselects > 1)
+        {
+            /* We have more than one select request, let's use points caching.
+             * (Not critical, everything works if points_map is NULL) */
+            q_select->points_map = imap_new();
+        }
     }
 
     SIRIPARSER_ASYNC_NEXT_NODE